package de.fuberlin.inf.alp3.ue06;

public class Less extends BinaryOp {

    Less(Expression left, Expression right) {
        super(left, right);
    }

    @Override
    public Expression eval() {
        try {
            return new Boolean( (((Integer) left.eval()).getValue()) < (((Integer) right.eval()).getValue()));
        } catch (ClassCastException e) {
            throw new RuntimeException("Operands of Less must be integers");
        }
    }
}